home *** CD-ROM | disk | FTP | other *** search
/ A.C.E. 1 / ACE CD 1.iso / files / utils / acroarex.dms / in.adf / Examples / zooall.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1994-06-09  |  1.1 KB  |  57 lines

  1. /* zooall.rexx                        */
  2. /*    Rexx program to zoo every directory        */
  3.  
  4. address command
  5. parse upper arg path
  6.  
  7. if ~show('L',"rexxsupport.library") then
  8.    call addlib "rexxsupport.library",0,-30
  9.  
  10. if ~show('L',"rexxmathlib.library") then
  11.    call addlib "rexxmathlib.library",0,-30
  12.  
  13. list = getlist()
  14. workpath = path
  15. parse value list with name list
  16. do while name ~= ''
  17.  
  18.     outpath = "df1:"
  19.     cnt = lastpos('/',name)
  20.     if cnt ~= 0
  21.     then do
  22.         outpath = outpath||substr(name,1,cnt)
  23.         end
  24.  
  25.     outname = strip(name,"b","/")
  26.     cnt = lastpos('/',outname)
  27.     if cnt ~= 0
  28.     then outname = substr(outname,cnt+1)
  29.  
  30.     path = workpath
  31.     cnt = lastpos('/',name)
  32.     if cnt ~= 0
  33.     then do
  34.         path = path||substr(name,1,cnt)
  35.         name = substr(name,cnt+1)
  36.         end
  37.  
  38.     call pragma('D',path)
  39.     'makedir' strip(outpath,'t','/')
  40.     t = showdir(path,'F')
  41.     if t ~= ''
  42.     then 'zoo -add 'outpath||outname'.zoo *'
  43.         parse value list with name list
  44.         end
  45.     exit
  46.  
  47. getlist: procedure expose path
  48.     parse arg extra
  49.     list = ''
  50.     dir = showdir(path||extra,'D')
  51.     do while dir ~= ''
  52.         parse var dir curr dir
  53.         list = list extra||curr'/'
  54.             list = list getlist(extra||curr'/')
  55.         end
  56.     return list
  57.